<?php


namespace apps\marriage\app\mp\controller;

use apps\marriage\core\service\UserWithdrawAccountService;
use think\Request;

class UserWithdrawAccountController extends BaseMarriageMpController
{
    /**
     * @var UserWithdrawAccountService
     */
    private $userWithdrawAccountService;

    protected function init()
    {
        parent::init();
        $this->userWithdrawAccountService = service('UserWithdrawAccount', SERVICE_NAMESPACE);
    }

    public function my()
    {
        $data = $this->userWithdrawAccountService->getUserId($this->user['id']);
        return $this->success($data);
    }

    public function save(Request $request)
    {
        $data = $request->param();
        $data['user_id'] = $this->user['id'];
        $this->userWithdrawAccountService->save($data);
        return $this->success();
    }
}